//查询所有店铺名称
function getAllShopkeeperName() {
    return $axios({
        url: '/shopkeeper/getAllShopkeeperName',
        method: 'get',
    })
}

//分页查询店铺信息
const getShopKeeperPage = (params) => {
    return $axios({
        url: '/shopkeeper/page',
        method: 'get',
        params
    })
}

//根据id获取店铺信息
const queryShopKeeperById = (id) => {
    return $axios({
        url: `/shopkeeper/getShopkeeperMsg/${id}`,
        method: 'get'
    })
}

const getStadiumDetail = (id) => {
    return $axios({
        url: `/stadium/detail/${id}`,
        method: 'get'
    })
}

//修改店铺状态（启用/停用）
function enableOrDisableShopkeeper(params) {
    return $axios({
        url: '/shopkeeper/updateShopkeeperStatus',
        method: 'put',
        data: {...params}
    })
}

//修改店铺信息（店主+店铺）
const updateShopkeeperInfo = (data) => {
    return $axios({
        url: '/shopkeeper/updateShopkeeper',
        method: 'put',
        data: data
    })
}

// 查询店铺中的老师信息
function getTeachersOfShopkeeper(id) {
    return $axios({
        url: '/shopkeeper/getTeachersOfShopkeeper?shopkeeperId=' + id,
        method: 'get'
    })
}

// 查询店铺中的课程信息
function getCourseOfShopkeeper(id) {
    return $axios({
        url: '/shopkeeper/getCourseOfShopkeeper?shopkeeperId=' + id,
        method: 'get'
    })
}

//根据类型获取标签  getTagListByType
function getTagListByType(type) {
    return $axios({
        'url': '/tags/getTagListByType?type=' + type,
        'method': 'get',
    })
}


//修改课程信息
function updateCourse(params) {
    return $axios({
        url: '/shopkeeper/updateCourse',
        method: 'post',
        data: params,
        // headers: {
        //     'Cache-Control': 'no-cache', // 添加缓存控制头
        //     'Pragma': 'no-cache'
        // }
    });
}

// 删除课程
function deleteCourse(params) {
    return $axios({
        url: `/shopkeeper/deleteCourse`,
        method: 'delete',
        data: params
    });
}

// 根据shopkeeperId查询本店的办卡信息   张/名
function getCardStats(params) {
    return $axios({
        url: '/shopkeeper/getCardStats',
        method: 'get',
        params
    })
}

// 计算收入，显示在柱状图
function getIncome(params) {
    return $axios({
        url: '/shopkeeper/getIncome',
        method: 'get',
        params
    })
}

